package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class MethodSpecificationList {

    private int beginIndex;
    private int endIndex;
    private List<MethodSpecification> methodSpecificationList;

    public MethodSpecificationList(List<MethodSpecification> methodSpecificationList) {
        this.beginIndex = methodSpecificationList.get(0).getBeginIndex();
        this.endIndex = methodSpecificationList.get(methodSpecificationList.size() - 1).getEndIndex();
        this.methodSpecificationList = methodSpecificationList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public boolean isEmpty() {
        return methodSpecificationList == null ? true : methodSpecificationList.isEmpty();
    }

    public int size() {
        return methodSpecificationList == null ? 0 : methodSpecificationList.size();
    }

    public MethodSpecification get(int index) {
        return methodSpecificationList == null ? null : methodSpecificationList.get(index);
    }

}
